home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / hplip.postrm < prev    next >
Text File  |  2008-10-13  |  2KB  |  79 lines

  1. #! /bin/sh
  2. # postrm script for hplip
  3. #
  4. # see: dh_installdeb(1)
  5.  
  6. set -e
  7.  
  8. # summary of how this script can be called:
  9. #        * <postrm> `remove'
  10. #        * <postrm> `purge'
  11. #        * <old-postrm> `upgrade' <new-version>
  12. #        * <new-postrm> `failed-upgrade' <old-version>
  13. #        * <new-postrm> `abort-install'
  14. #        * <new-postrm> `abort-install' <old-version>
  15. #        * <new-postrm> `abort-upgrade' <old-version>
  16. #        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
  17. # for details, see http://www.debian.org/doc/debian-policy/ or
  18. # the debian-policy package
  19.  
  20. # Kill any pre-compiled python crap
  21. kill_python_crappage() {
  22.     [ -d /usr/share/hplip ] && \
  23.         find /usr/share/hplip \
  24.             \( -name '*.pyc' -o -name '*.pyo' \) \
  25.             -exec rm -f {} \;
  26.     :
  27. }
  28.  
  29.  
  30. case "$1" in
  31.     failed-upgrade|abort-install|abort-upgrade)
  32.         # Remove the symlink, no matter what. If it is
  33.         # needed, dpkg will recreate it.  This is in an
  34.         # downgrade/failed upgrade unwind path
  35.         if [ -h /usr/share/doc/hplip ]; then
  36.             rm -f /usr/share/doc/hplip
  37.         fi
  38.         # and kill any crap left over for failed-upgrade
  39.         kill_python_crappage
  40.     ;;
  41.     upgrade)
  42.         # support downgrading
  43.         if [ -h /usr/share/doc/hplip ]; then
  44.             rm -f /usr/share/doc/hplip
  45.         fi
  46.     ;;
  47.     remove|disappear)
  48.         kill_python_crappage
  49.     ;;
  50.     purge)
  51.         kill_python_crappage
  52.  
  53.         for i in /var/run/hplip ; do
  54.             dpkg-statoverride --remove $i || true
  55.         done
  56.  
  57.             [ -d /var/run/hplip ] && rm -fr /var/run/hplip
  58.     ;;
  59.     *)
  60.         echo "postrm called with unknown argument \`$1'" >&2
  61.         exit 1
  62.  
  63. esac
  64.  
  65. # dh_installdeb will replace this with shell code automatically
  66. # generated by other debhelper scripts.
  67.  
  68. # Automatically added by dh_installmenu
  69. if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
  70. # End automatically added section
  71. # Automatically added by dh_makeshlibs
  72. if [ "$1" = "remove" ]; then
  73.     ldconfig
  74. fi
  75. # End automatically added section
  76.  
  77.  
  78. exit 0
  79.